package com.study.www.config;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author : Administrator.zhuyanpeng
 * @date : 2019/11/12 - 11:37
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private String code;
    private String message;
    private Object data;
    private Date date;


    public Result(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static Result error(String code, String message) {
        Result result = new Result(code, message);
        result.setDate(new Date());
        return result;

    }
}
